package com.my.mybits.mapper;

import com.my.mybits.po.User;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    User findUserByUserIdEx(Integer userId);

    @Select("select * from user where user_id=#{userId};")
    @Results({@Result(id = true,column = "user_id",property = "userId"),
            @Result(property = "bookList",column = "user_id",many =
            @Many(select = "com.my.mybits.mapper.BookMapper.findBookByUserId"))
    })
    User findUserByUserId(int userId);

}
